package com.kkb.robotcustomerservice.service.impl;

import com.kkb.robotcustomerservice.dao.InvertedIndexDao;
import com.kkb.robotcustomerservice.entities.InvertedIndex;
import com.kkb.robotcustomerservice.service.InvertedIndexService;
import com.kkb.robotcustomerservice.util.JsonUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author 0715-YuHao
 * @version 1.0
 * @className InvertedIndexServiceImpl
 * @description TODO
 * @date 2020/11/26 22:06
 */
@Service
public class InvertedIndexServiceImpl implements InvertedIndexService {

    @Autowired
    private InvertedIndexDao dao;

    @Override
    public int addIndex(InvertedIndex index) {
        return dao.insert(index);
    }

    @Override
    public List<Integer> getQueId(String word) {
        return JsonUtils.jsonToList(dao.getQueId(word), Integer.class);
    }
}
